/* reset */
button {
  all: unset;
}

.dropdown-menu-content,
.dropdown-menu-subcontent {
  min-width: 220px;
  background-color: var(--swm-popover-background);
  border-radius: 6px;
  border: var(--swm-dropdown-border);
  box-shadow: var(--swm-dropdown-shadow);
  padding: 4px;
  animation-duration: 400ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  max-height: calc(var(--radix-dropdown-menu-content-available-height) - 40px);
  overflow-y: auto;

  --menu-item-padding: 0 6px;
  --base-transform: translateX(0) translateY(0);
}

.dropdown-menu-subcontent {
  max-height: calc(var(--radix-dropdown-menu-content-available-height));

  .label {
    padding: var(--menu-item-padding);
  }
}

.dropdown-menu-content[data-side="bottom"],
.dropdown-menu-subcontent[data-side="bottom"] {
  animation-name: slideUpAndFade;
}

.dropdown-menu-content[data-side="top"],
.dropdown-menu-subcontent[data-side="top"] {
  animation-name: slideDownAndFade;
}
.dropdown-menu-content[data-side="left"],
.dropdown-menu-subcontent[data-side="left"] {
  animation-name: slideRightAndFade;
}
.dropdown-menu-content[data-side="right"],
.dropdown-menu-subcontent[data-side="right"] {
  animation-name: slideLeftAndFade;
}

.dropdown-menu-item {
  font-size: 13px;
  line-height: 1;
  color: var(--swm-default-text);
  border-radius: 3px;
  display: flex;
  align-items: center;
  height: 28px;
  padding: var(--menu-item-padding);
  position: relative;
  user-select: none;
  outline: none;
  gap: 4px;
}
.dropdown-menu-item[data-disabled] {
  color: var(--swm-disabled-text);
  pointer-events: none;
}
.dropdown-menu-item[data-highlighted] {
  background-color: var(--swm-dropdown-item-highlighted);
  color: var(--swm-default-text);
}

.dropdown-menu-item-wraper {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 5px;
}

.dropdown-menu-item-content {
  display: flex;
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
}

.dropdown-menu-label {
  font-size: 12px;
  line-height: 25px;
  padding-left: 5px;
  color: var(--swm-secondary-text);
}

.dropdown-menu-separator {
  height: 1px;
  background-color: var(--swm-separator);
  margin: 5px;
}

.dropdown-menu-arrow {
  fill: var(--swm-popover-background);
  height: 0;
}

.right-slot {
  margin-left: auto;
  padding-left: 20px;
}
[data-highlighted] > .right-slot {
  color: var(--swm-default-text);
}
[data-disabled] .right-slot {
  color: var(--swm-disabled-text);
}

@keyframes slideUpAndFade {
  from {
    opacity: 0;
    transform: var(--base-transform) translateY(3px);
  }
  to {
    opacity: 1;
    transform: var(--base-transform) translateY(0);
  }
}

@keyframes slideDownAndFade {
  from {
    opacity: 0;
    transform: var(--base-transform) translateY(-3px);
  }
  to {
    opacity: 1;
    transform: var(--base-transform) translateY(0);
  }
}

@keyframes slideRightAndFade {
  from {
    opacity: 0;
    transform: var(--base-transform) translateX(-2px);
  }
  to {
    opacity: 1;
    transform: var(--base-transform) translateX(0);
  }
}

@keyframes slideLeftAndFade {
  from {
    opacity: 0;
    transform: var(--base-transform) translateX(2px);
  }
  to {
    opacity: 1;
    transform: var(--base-transform) translateX(0);
  }
}

@media (max-width: 460px) {
  .dropdown-menu-subcontent {
    --base-transform: translateX(85%) translateY(28px);
    transform: var(--base-transform);
  }

  .dropdown-menu-content[data-side="left"],
  .dropdown-menu-subcontent[data-side="left"] {
    animation-name: slideUpAndFade;
  }
  .dropdown-menu-content[data-side="right"],
  .dropdown-menu-subcontent[data-side="right"] {
    animation-name: slideUpAndFade;
  }
}
